@using OrchardCore.DisplayManagement
@using OrchardCore.Layers.Models

@{ 
    ContentItem widget = Model.Widget;
    var layerMetadata = widget.As<LayerMetadata>();
    bool rendertitle = layerMetadata.RenderTitle;
}

<div class="widget-container">
    @if (rendertitle)
    {
        var widgetTitle = await Factory.CreateAsync("Widget_Title", new { Widget = widget });
        widgetTitle.Metadata.Alternates.Add("Widget_Title__" + widget.ContentType);

        @await DisplayAsync(widgetTitle)
    }

    @await DisplayAsync(Model.Content)
</div>
